<%-- 
    Document   : CodePool
    Created on : 14.12.2011, 4:21:01
    Author     : Jano
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

<%--<table border="2">
        <TR><TD></TD></TR>
        <%
            for (Iterator i = calendar.getComponents().iterator(); i.hasNext();) {
        %><TR><%
            Component component = (Component) i.next();
            %><TD>Component:</TD><TD><%=component.getName()%></TD></TR><%
                for (Iterator j = component.getProperties().iterator(); j.hasNext();) {
            %><TR><%
                Property property = (Property) j.next();
            %><TD><%=property.getName()%></TD><TD><%=property.getValue()%></TD></TR><%
                    }
                }
            %>
    </table>
    <%
        }
    %>--%>




<%-- 
    Document   : index
    Created on : 13.12.2011, 23:33:23
    Author     : Jano

<%
    String main = request.getParameter("main");
    String load = request.getParameter("loadall");
    String add = request.getParameter("add");
    String addData = request.getParameter("addData");
    String edit = request.getParameter("edit");
    String remove = request.getParameter("remove");
    boolean write = false;
    if ((add != null) || (edit != null) || (remove != null)) {
        write = true;
    }
    boolean get = request.getMethod().equals("GET");
    boolean post = request.getMethod().equals("POST");
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <%if (request.getAttribute("f5") != null) {
        %>
        <script type="text/javascript">
            <!--    
            window.location = "http://localhost:8084/TrinityWeb/"
        </script>
        <%            }
        %>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Trinity</title>
    </head>
    <body>
        <div style="text-align: center">
            <br/>
            <form method="post">
                <input type="submit" name="main" value="Main page"/>
                <input type="submit" name="loadall" value="Load the calendar"/>
                <input type="submit" name="add" value="Add event"/>
            </form>
        </div><br/>
        <div style="text-align: center">
            <%
                if (get || (post && (load == null) && (write == false))) {
                    if (main != null && (request.getAttribute("f5") == null)) {
                        request.setAttribute("f5", "f5");
                        request.getRequestDispatcher("/index.jsp").forward(request, response);
                    }
            %>
            Choose an option.
            <%            } else if (load != null) {
                request.setAttribute("user", "Rosaldo");
                request.getRequestDispatcher("/loadEvents.jsp").include(request, response);
            } else if (write) {
                if (add != null) {
                    request.setAttribute("user", "Rosaldo");
                    request.setAttribute("input", "prepare");
                    request.getRequestDispatcher("/addEvent.jsp").include(request, response);
                }
            }
            %>
        </div>
    </body>
</html>
--%>